<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
  <head>
    <title>CsvUpload.html</title>
	
    <meta name="keywords" content="keyword1,keyword2,keyword3">
    <meta name="description" content="this is my page">
    <meta name="content-type" content="text/html; charset=UTF-8">
    
    <!--<link rel="stylesheet" type="text/css" href="./styles.css">-->

  </head>
  <script type="text/javascript">
  function checkstring(obj){
  	var first=obj[0];
  	if(!( (first>='a'&&first<='z') || (first >='A'&&first <='Z') )){
  		return false;
  	}
  	return true;
  }
  function checknum(obj,name){
  	if(obj==""||obj==null){alert(name+"应为整数");return false;}
  	//if(!isNaN(obj)){
  	//	return true;//num
  	//}
  	
  	var reg=new RegExp("^[0-9]+[0-9]*$"); 
  	if(reg.test(obj)){
  		return true;
  	}
  	
  	alert(name+"应为整数");
  	return false;
  }
  function checkform(obj)
  {
  	with(obj){
  		if(!checkstring(obj.tablename.value)){
  			//alert("表名首位应为字母");
  			//return false;
  		}else if(!checknum(obj.row.value,"row")){
  			return false;
  		}
  		else if(!checknum(obj.column.value,"column")){
  			return false;
  		}
  		else if(!checknum(obj.rownum.value,"rownum")){
  			return false;
  		}
  		else if(!checknum(obj.columnnum.value,"columnnum")){
  			return false;
  		}
  		else if(!checknum(obj.sheetnum.value,"sheetnum")){
  			return false;
  		}
  	}
  }
  </script>
  <body>
  	<a href="CsvUpload.jsp">CsvUpload</a>
    <h3>File Upload:(post) action="UploadExcel"</h3>
	Select a file to upload: <br />
	<form method="post" enctype="multipart/form-data" action="UploadExcel" onsubmit="return checkform(this);">
		<input type="file" name="file" size="50" />
		<br />
		tablename:<br />
		<input type="text" name="tablename" size =40 />
		<br />
		row:row>=0<br />
		<input type="text" name="row" size =40 />
		<br />
		column:column>=0<br />
		<input type="text" name="column" size =40 />
		<br />
		row num:num>0<br />
		<input type="text" name="rownum" size =40 />
		<br />
		column num:num>0<br />
		<input type="text" name="columnnum" size =40 />
		<br />
		sheet:sheet>=0(工作表号)<br />
		<input type="text" name="sheetnum" size =40 />
		<br />
		创建人createuser：(默认admin)<br>
		<input type="text" name="createuser" size =40/><br>
		审核人reviewer(不填=未审核)<br>
		<input type="text" name="reviewer" size=40 /><br>
		开放标志IsOpen (默认0)<br>
		<input type="text" name="IsOpen" size=40/><br>
		注释comment<br>
		<input type="text" name="comment" size=40/><br>
		<input type="submit" value="Upload File" />
	</form>

	<br>
	<h3>审核提交(get/post) action="ReviewTable"</h3>
	<form method="post" action="ReviewTable">
		tablename:<br />
		<input type="text" name="tablename" size=40/><br>
		审核人reviewer<br>
		<input type="text" name="reviewer" size=40 /><br>
		<input type="submit" value="submit" />
	</form>
  </body>
</html>
